package com.hzhc.controller.trainPlan;

import com.hzhc.annotation.SysTemLog;
import com.hzhc.common.BaseController;
import com.hzhc.dto.UserDto;
import com.hzhc.service.*;
import com.hzhc.utils.TokenUtil;
import com.hzhc.vo.*;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author 功不唐捐
 * @date 2024-10-24
 * @description TrainPlanDetailController
 */
@RestController
@RequestMapping("/trainPlanDetail")
@RequiredArgsConstructor
public class TrainPlanDetailController extends BaseController {

    private final TrainPlanDetailService detailService;

    /**
     * 装卸清单--导出
     * @param request
     * @param response
     * @param vo
     */
    @GetMapping("/exportZxDetail")
    @SysTemLog(operModul = "装卸清单导出", operType = "导出", operDesc = "装卸清单导出功能", modular="YZS")
    public void exportZxDetail(HttpServletRequest request, HttpServletResponse response,TrainPlanDetailVo vo) {
        UserDto user = TokenUtil.getUserMember(request);
        vo.setConsignee(user.getCompanyName());
        detailService.exportZxDetail(request, response, vo);
    }
}
